/**
  * The digital avatar of the player
  *
  * @author "Brian MacCarthy";
  * @created "2007-03-04 Brian MacCarthy";
  * @revised "$Date: 2007-03-06 19:11:00 $"; 
  */

package exfist;

public class Character extends Player
{
	private int Pos_X,Pos_Y;
	private int width,height;
	private int health;
	private int rightside,bottom;
	private Punches p;
	private Kicks k;
	private Movement m;
	protected Character()
	{
		m=new Movement();
		p=new Punches();
		k=new Kicks();
		this.setHealth(100);
		this.setWidth(80);
		this.setHeight(110);
		this.setPosition(0, 0);
	}
	/**
	 * (x,y) is the top left of the box.
	 * a players collision box is the x coordinate + a number of pixels,same for the y coordinate.(at the moment just 20 for x and 60 for y)
	 *
	 */
	private void drawChar()
	{
		assert false;
	}
	protected boolean isKO()
	{
		if(getHealth()<=0)
		{
			return true;
		}
		else return false;
	}
	private int getHealth()
	{
		return health;
	}
	private void setHealth(int h)
	{
		health = h;
	}
	protected void reduceHealth(int h)
	{
		health -= h;
	}
	private int getPositionX()
	{
		return Pos_X;
	}
	private int getPositionY()
	{
		return Pos_Y;
	}
	private void setWidth(int w)
	{
		width = w;
	}
	private void setHeight(int h)
	{
		height = h ;
	}
	private void setPosition(int x,int y)
	{
		setPositionX(x);
		setPositionY(y);
		updateCollisionBox();
	}
	private void setPositionX(int x)
	{
		Pos_X = x;
	}
	private void setPositionY(int y)
	{
		Pos_Y = y;
	}
	private boolean isColliding(Character c)
	{
	if(this.rightside > c.Pos_X && this.Pos_X < c.rightside)
		{
			if(this.bottom>c.Pos_Y && this.Pos_Y<c.bottom)
			{
				return true;
			}
			
		}
			return false;
	}
	private void updateCollisionBox()
	{
		rightside = Pos_X+width;
		bottom = Pos_Y+height;
	}
}
